package com.cheyunkeji.er.view;

import android.content.Context;
import android.util.AttributeSet;
import android.widget.ScrollView;

/**
 * Created by Michael on 2017/9/7 22:31.
 */

public class TranslucentScrollView extends ScrollView {

    private mOnScrollChangedListener listener ;

    public TranslucentScrollView(Context context) {
        super(context);
    }

    public TranslucentScrollView(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    public TranslucentScrollView(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
    }

    @Override
    protected void onScrollChanged(int l, int t, int oldl, int oldt) {
        super.onScrollChanged(l, t, oldl, oldt);

        if( null != listener ){
            listener.onScrollChanged(this,l,t,oldl,oldt);
        }
    }

    public void setOnScrollChangedListener(mOnScrollChangedListener listener) {
        this.listener = listener;
    }


    public interface  mOnScrollChangedListener {

        void onScrollChanged(ScrollView who, int l, int t, int oldL, int oldT);
    }

}
